home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 104 / MacAddict_104_2005-04.iso / Software / Internet & Communication / WordPress 1.2.2 freeware.dmg / wordpress / wp-admin / options-general.php < prev    next >
Encoding:
PHP Script  |  2004-05-08  |  5.2 KB  |  120 lines

  1. <?php
  2. require_once('../wp-includes/wp-l10n.php');
  3.  
  4. $title = __('General Options');
  5.  
  6. function add_magic_quotes($array) {
  7.     foreach ($array as $k => $v) {
  8.         if (is_array($v)) {
  9.             $array[$k] = add_magic_quotes($v);
  10.         } else {
  11.             $array[$k] = addslashes($v);
  12.         }
  13.     }
  14.     return $array;
  15. }
  16.  
  17. if (!get_magic_quotes_gpc()) {
  18.     $_GET    = add_magic_quotes($_GET);
  19.     $_POST   = add_magic_quotes($_POST);
  20.     $_COOKIE = add_magic_quotes($_COOKIE);
  21. }
  22.  
  23. $wpvarstoreset = array('action','standalone', 'option_group_id');
  24. for ($i=0; $i<count($wpvarstoreset); $i += 1) {
  25.     $wpvar = $wpvarstoreset[$i];
  26.     if (!isset($$wpvar)) {
  27.         if (empty($_POST["$wpvar"])) {
  28.             if (empty($_GET["$wpvar"])) {
  29.                 $$wpvar = '';
  30.             } else {
  31.                 $$wpvar = $_GET["$wpvar"];
  32.             }
  33.         } else {
  34.             $$wpvar = $_POST["$wpvar"];
  35.         }
  36.     }
  37. }
  38.  
  39.  
  40. $standalone = 0;
  41. include_once('admin-header.php');
  42. include('options-head.php');
  43. ?>
  44.  
  45. <div class="wrap"> 
  46.   <h2><?php _e('General Options') ?></h2> 
  47.   <form name="form1" method="post" action="options.php"> 
  48.     <input type="hidden" name="action" value="update" /> 
  49.     <input type="hidden" name="action" value="update" /> <input type="hidden" name="page_options" value="'blogname','blogdescription','siteurl','admin_email','users_can_register','new_users_can_blog','gmt_offset','date_format','time_format','home'" /> 
  50.     <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  51.       <tr valign="top"> 
  52.         <th width="33%" scope="row"><?php _e('Weblog title:') ?></th> 
  53.         <td><input name="blogname" type="text" id="blogname" value="<?php echo get_settings('blogname'); ?>" size="40" /></td> 
  54.       </tr> 
  55.       <tr valign="top"> 
  56.         <th scope="row"><?php _e('Tagline:') ?></th> 
  57.         <td><input name="blogdescription" type="text" id="blogdescription" style="width: 95%" value="<?php echo get_settings('blogdescription'); ?>" size="45" />
  58.         <br />
  59. <?php _e('In a few words, explain what this weblog is about.') ?></td> 
  60.       </tr> 
  61.       <tr valign="top"> 
  62.         <th scope="row"><?php _e('WordPress address (URI):') ?></th> 
  63.         <td><input name="siteurl" type="text" id="siteurl" value="<?php echo get_settings('siteurl'); ?>" size="40" class="code" /></td> 
  64.       </tr> 
  65.       <tr valign="top">
  66.           <th scope="row"><?php _e('Blog address (URI):') ?></th>
  67.           <td><input name="home" type="text" id="home" value="<?php echo get_settings('home'); ?>" size="40" class="code" /><br /><?php _e('If you want your blog homepage to be different than the directory you installed WordPress in, enter that address here. '); ?></td>
  68.           </tr>
  69.       <tr valign="top"> 
  70.         <th scope="row"><?php _e('E-mail address:') ?> </th> 
  71.         <td><input name="admin_email" type="text" id="admin_email" value="<?php echo get_settings('admin_email'); ?>" size="40" class="code" />
  72.         <br />
  73. <?php _e('This address is used only for admin purposes.') ?></td> 
  74.       </tr>
  75.       <tr valign="top"> 
  76.         <th scope="row"><?php _e('Membership:') ?></th> 
  77.         <td> <label for="users_can_register"> 
  78.           <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> /> 
  79.           <?php _e('Anyone can register') ?></label> 
  80.           <br /> 
  81.           <label for="new_users_can_blog"> 
  82.           <input name="new_users_can_blog" type="checkbox" id="new_users_can_blog" value="1" <?php checked('1', get_settings('new_users_can_blog')); ?> /> 
  83.           <?php _e('Any registered member can publish articles') ?> </label></td> 
  84.       </tr> 
  85.     </table> 
  86.     <fieldset class="options"> 
  87.     <legend><?php _e('Date and Time') ?></legend> 
  88.         <table width="100%" cellspacing="2" cellpadding="5" class="editform"> 
  89.       <tr> 
  90.           <th scope="row" width="33%"><?php _e('<acronym title="Greenwich Meridian Time">GMT</acronym> time is:') ?> </th> 
  91.         <td><code><?php echo gmdate('Y-m-d g:i:s a'); ?></code></td> 
  92.       </tr>
  93.       <tr>
  94.         <th scope="row"><?php _e('Times in the weblog should differ by:') ?> </th>
  95.         <td><input name="gmt_offset" type="text" id="gmt_offset" size="2" value="<?php echo get_settings('gmt_offset'); ?>" /> 
  96.         <?php _e('hours') ?> </td>
  97.       </tr>
  98.       <tr>
  99.           <th scope="row"> </th>
  100.           <td><?php _e('The following use the same syntax as the <a href="http://php.net/date">PHP <code>date()</code> function</a>. Save option to update sample output.') ?> </td>
  101.           </tr>
  102.       <tr>
  103.           <th scope="row"><?php _e('Default date format:') ?></th>
  104.           <td><input name="date_format" type="text" id="date_format" size="30" value="<?php echo get_settings('date_format'); ?>" /><br />
  105. <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('date_format'), current_time('timestamp')); ?></strong></td>
  106.           </tr>
  107.       <tr>
  108.         <th scope="row"><?php _e('Default time format:') ?></th>
  109.           <td><input name="time_format" type="text" id="time_format" size="30" value="<?php echo get_settings('time_format'); ?>" /><br />
  110. <?php _e('Output:') ?> <strong><?php echo gmdate(get_settings('time_format'), current_time('timestamp')); ?></strong></td>
  111.           </tr> 
  112. </table>
  113.  
  114.     </fieldset> 
  115.     <p class="submit">
  116.       <input type="submit" name="Submit" value="<?php _e('Update Options') ?> »" />
  117.     </p>
  118.   </form> 
  119. </div> 
  120. <?php include("admin-footer.php") ?>